css: Add a workaround for gtk_widget_override_font()
authorBenjamin Otte <otte@redhat.com>
Tue, 14 Nov 2017 03:03:57 +0000 (04:03 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 5 Feb 2018 17:49:10 +0000 (18:49 +0100)
commit6ff326a82f1f7f13f8e0822576f19bb53c7b1fd8
tree87cbce300645a084ecd11d0766b300bfb2d16906
parent8af082f3c7da5fb15ab9b95d460dd285376ca17b
css: Add a workaround for gtk_widget_override_font()

The problem here is that the CSS machinery expects font sizes to be in
pixels, but gtk_widget_override_font() provides a value in point and the
CSS machinery has no ability to query the DPI and convert.

This patch changes the dconversion DPI we use from a hardcoded 96 to the
default screen's DPI, which should work better than before.
This will of course not listen to changes in the default screen's DPI,
but that shouldn't be a problem.

People who want to workaround this should use gtk_widget_override_font()
with a font that has an absolute size set via
pango_font_description_set_absolute_size (size * PANGO_SCALE *
                                          gdk_screen_get_resolution (screen));

https://bugzilla.gnome.org/show_bug.cgi?id=774248
gtk/gtkcssshorthandpropertyimpl.c